package br.com.treinaweb.parte1;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class GravarEventos extends HttpServlet {

  private static final long serialVersionUID = 4241631494665038999L;

  protected void doGet(HttpServletRequest request,HttpServletResponse response)
  throws ServletException, IOException{
    String evento = request.getParameter("evento");
    String dataEvento = request.getParameter("data");
      
    response.setContentType("text/html;charset=ISO-8859-1");
    PrintWriter out = response.getWriter();
    out.println("<head>");
    out.println("<title>Gravando Eventos no Hibernate</title>");
    out.println("<LINK href='estilo.css' type='text/css' rel='stylesheet' />");
    out.println("</head>");
    out.println("<html>");
    out.println("<body>");
    out.println("<h2>Gravando Eventos no Hibernate</h2>");
    out.println("Evento: " + evento + " ");
    out.println("Data: " + dataEvento + " ");
      
    GerenciadorEventos c = new GerenciadorEventos();
    c.salvarEvento(evento,dataEvento);
      
    out.println("</body>");
    out.println("</html>");
    out.close();
  }
}
